#pragma once
#include"hashbucket.h"
namespace bit
{

    template<class K>
    struct HashFunc
    {
        size_t operator()(const K& key)
        {
            return (size_t)key;
        }
    };
    template<class K, class Hash = HashFunc<K>>
    class unordered_set
    {
    public:
        struct SetKeyOfT
        {
            const K& operator()(const K& key)
            {
                return key;
            }
        };
       
        typedef typename  hash_bucket::HashTable<K, K, SetKeyOfT, Hash>::iterator iterator;
        //typedef typename  hash_bucket::HashTable<K, const K, SetKeyOfT, Hash>::const_iterator const_iterator;
        pair<iterator, bool> insert(const K& key)
        {
            return _ht.insert(key);
        }
        terator begin()
        {
            return _ht.begin();
        }
        iterator end()
        {
            return _ht.end();
        }
        bool erase(const K& key)
        {
            return _ht.Erase(key);
        }
    private:
        hash_bucket::HashTable<K, K, SetKeyOfT, Hash> _ht;
    };
}